<?php
error_reporting ( E_ALL | E_STRICT );
define ( 'X_APP', 1 );
/**
 * ROOT_PATH
 * 站点根路径，末尾已经加了‘/'
 *
 * @var string
 */
define ( 'ROOT_PATH', dirname ( __FILE__ ) . '/', false );
$GLOBALS ['start_time'] = microtime ( true ); // 开始计时
/* 加载配置文件 */
require_once ROOT_PATH . 'config/errno.php';
require_once ROOT_PATH . 'config/config.php';
require_once ROOT_PATH . 'config/define.php';
require_once ROOT_PATH . 'config/dbconf.php';
/* 加载第三方开源库 */
require_once ROOT_PATH . 'lib/logger/Logger.php';
require_once ROOT_PATH . 'lib/smarty/Smarty.class.php';
require_once ROOT_PATH . 'lib/db/ConnectorFactory.php';
require_once ROOT_PATH . 'lib/HtmLawed/htmLawed.php';
require_once ROOT_PATH . 'lib/image/WideImage.php';
require_once ROOT_PATH . 'lib/mail/class.phpmailer.php';
/* 加载框架装载器 */
require_once ROOT_PATH . 'framework/Loader.class.php';
/* 加载公共文件 */
require_once ROOT_PATH . 'include/GF.class.php';
require_once ROOT_PATH . 'include/SmartyViewHelper.class.php';
require_once ROOT_PATH . 'include/DBHelper.class.php';
require_once ROOT_PATH . 'include/Connection.php';
require_once ROOT_PATH . 'include/AppLoader.class.php';

@ini_set ( 'magic_qoutes_runtime', 0 );

// 设置默认时区
GF::SetDateTimeZone ( 'Etc/GMT-8' );
// 清理全剧变量
GF::Unregister_GLOBALS ();
GF::Fix_server_vars ();
// 开启缓冲
ob_start ();

// Logger::configure ( ROOT_PATH . 'config/log_config.xml' );
// $g_logger = Logger::getLogger ( "GLOBAL" );
// TODO: 设置logger的配置文件
SessionManager::getSingleton ()->startSession ();
// TODO: 处理国际化问题